// 1. express 框架
const express = require("express");

// 2.创建一个后台路由
const router = express.Router();

const searchModel = require("../../model/searchModel");

router.post("/searchlist", async (req, res) => {
    let { search } = req.body;
    await searchModel
        .get_search_list(search)
        .then((content) => {
            res.send({
                code: 200,
                content,
            });
        })
        .catch((error) => {
            res.send({
                code: -1,
                error,
            });
        });
});

module.exports = router;
